const state = {
  name: '',
  isLogin: false,
  token: ''
}

const getters = {
  'getUser': (state) => state
}

const actions = {
  'login' ({commit}, item) {
    commit('doLogin', item)
  }
}

const mutations = {
  'doLogin' (state, item) {
    state.name = item.name
    state.isLogin = item.isLogin
    state.token = item.token
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}
